<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>

<script>
// This test checks createRadialGradient with infinite values
var ctx = document.createElement('canvas').getContext('2d');

function testcreateRadialGradient(params)
{
    x0 = params[0]; y0 = params[1]; r0 = params[2];
    x1 = params[3]; y1 = params[4]; r1 = params[5];
    assert_throws_js(TypeError, function() {
      ctx.createRadialGradient(x0, y0, r0, x1, y1, r1);
    });
}

var testScenarios = [
    ['Test createRadialGradient(0, 0, 100, 0, 0, NaN)', [0, 0, 100, 0, 0, NaN]],
    ['Test createRadialGradient(0, 0, 100, 0, 0, Infinity)', [0, 0, 100, 0, 0, Infinity]],
    ['Test createRadialGradient(0, 0, 100, 0, 0, -Infinity)', [0, 0, 100, 0, 0, -Infinity]],
    ['Test createRadialGradient(0, 0, 100, 0, NaN, 100)', [0, 0, 100, 0, NaN, 100]],
    ['Test createRadialGradient(0, 0, 100, 0, Infinity, 100)', [0, 0, 100, 0, Infinity, 100]],
    ['Test createRadialGradient(0, 0, 100, 0, -Infinity, 100)', [0, 0, 100, 0, -Infinity, 100]],
    ['Test createRadialGradient(0, 0, 100, NaN, 0, 100)', [0, 0, 100, NaN, 0, 100]],
    ['Test createRadialGradient(0, 0, 100, Infinity, 0, 100)', [0, 0, 100, Infinity, 0, 100]],
    ['Test createRadialGradient(0, 0, 100, -Infinity, 0, 100)', [0, 0, 100, -Infinity, 0, 100]],
    ['Test createRadialGradient(0, 0, NaN, 0, 0, 100)', [0, 0, NaN, 0, 0, 100]],
    ['Test createRadialGradient(0, 0, Infinity, 0, 0, 100)', [0, 0, Infinity, 0, 0, 100]],
    ['Test createRadialGradient(0, 0, -Infinity, 0, 0, 100)', [0, 0, -Infinity, 0, 0, 100]],
    ['Test createRadialGradient(0, NaN, 100, 0, 0, 100)', [0, NaN, 100, 0, 0, 100]],
    ['Test createRadialGradient(0, Infinity, 100, 0, 0, 100)', [0, Infinity, 100, 0, 0, 100]],
    ['Test createRadialGradient(0, -Infinity, 100, 0, 0, 100)', [0, -Infinity, 100, 0, 0, 100]],
    ['Test createRadialGradient(NaN, 0, 100, 0, 0, 100)', [NaN, 0, 100, 0, 0, 100]],
    ['Test createRadialGradient(Infinity, 0, 100, 0, 0, 100)', [Infinity, 0, 100, 0, 0, 100]],
    ['Test createRadialGradient(-Infinity, 0, 100, 0, 0, 100)', [-Infinity, 0, 100, 0, 0, 100]],
];

generate_tests(testcreateRadialGradient, testScenarios);
</script>
